package com.colorlight.cloud.common.model;

import com.colorlight.cloud.common.model.enums.api.ExceptionInterface;
import lombok.Getter;

/**
 * @author Demon
 * 业务异常定义
 * 前缀 1000xx
 */
@Getter
public enum BaseResultCodeEnum implements ExceptionInterface<BaseResultCodeEnum> {
	UN_KNOWN(10000, "未知异常"),
	PARAMETER_EXCEPTION(10001, "参数异常"),
	EVENT_NOT_DELIVERED(10002,"上报事件不存在"),
	ANNOTATION_TARGET_EXCEPTION(10003, "annotation target exception"),
	PARTITION_OBJECT_IS_NOT_INTEGER_EXCEPTION(10003, "百分化对象必须为整数");
	/**
	 * 编码
	 */
	private final Integer code;
	
	/**
	 * 异常信息描述
	 */
	private final String description;
	
	
	BaseResultCodeEnum(Integer code, String description) {
		this.code = code;
		this.description = description;
	}
	
	@Override
	public Integer getCode() {
		return code;
	}
	
	@Override
	public BaseResultCodeEnum getT() {
		return this;
	}
	
	@Override
	public String getThisDescription() {
		return this.getDescription();
	}
}
